﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DiscoveryLogic.UIManager;
using Microsoft.Practices.Composite.Modularity;
using Microsoft.Practices.Composite.Regions;
using Microsoft.Practices.Unity;

namespace DiscoveryLogic.XamlParts.Views
{
	public class SolutionModule :IModule 
	{
		private readonly IUnityContainer container;
        private readonly IRegionManager regionManager;

		public SolutionModule(IUnityContainer container, IRegionManager regionManager)
        {
            this.container = container;
            this.regionManager = regionManager;
        }


		#region Implementation of IModule

		public void Initialize()
		{
			this.RegisterViewsAndServices();

			SolutionPresenter presenter = this.container.Resolve<SolutionPresenter>();

			IRegion mainRegion = this.regionManager.Regions[OutlookLikeRegionNames.SolutionNaviPane];
			mainRegion.Add(presenter.View);
		}

		#endregion

		protected void RegisterViewsAndServices()
		{
			//this.container.RegisterType<IEmployeesController, EmployeesController>();

			//// TODO: should be a singleton;
			//this.container.RegisterType<IEmployeeService, EmployeeService>();

			//this.container.RegisterType<IEmployeesView, EmployeesView>();

			//this.container.RegisterType<IEmployeesListView, EmployeesListView>();
			//this.container.RegisterType<IEmployeesListPresenter, EmployeesListPresenter>();

			//this.container.RegisterType<IEmployeesDetailsView, EmployeesDetailsView>();
			//this.container.RegisterType<IEmployeesDetailsPresenter, EmployeesDetailsPresenter>();
		}
	}
}
